

int  cpe_refresh_igd_wd_wanconnectiondevice(cwmp_t * cwmp, parameter_node_t * param_node, callback_register_func_t callback_reg)
{
    FUNCTION_TRACE();

    if(!param_node)
    {
        return FAULT_CODE_9002;
    }
    parameter_node_t * tmp_param, *tmp_node, *child_param;
    child_param = param_node->child;
    if(child_param)
    {
        for(tmp_param=child_param->next_sibling; tmp_param; )
        {
            cwmp_log_info("refresh WANConnectionDevice node, delete param %s\n", tmp_param->name);
            tmp_node = tmp_param->next_sibling;
            cwmp_model_delete_parameter(tmp_param);
            tmp_param = tmp_node;
        }
        child_param->next_sibling = NULL;

		cwmp_log_info("ready to get wan index");
        int wan_index = get_index_after_paramname(param_node, "WANDevice"); 

        cwmp_log_info("wan index is:%d", wan_index);
		
        parameter_node_t * wan1conn_param;
        cwmp_model_copy_parameter(param_node, &wan1conn_param, 1);
		
        if(wan_index == 2)
        {
             parameter_node_t * wan2conn_param;
             cwmp_model_copy_parameter(param_node, &wan2conn_param, 2);
        }

        cwmp_model_refresh_object(cwmp, param_node, 0, callback_reg); 
    }

    return FAULT_CODE_OK;
}


int cpe_del_igd_wanconnectiondevice(cwmp_t * cwmp, parameter_node_t * param_node, int instance_number,  callback_register_func_t callback_reg)
{
    cwmp_log_info("del object:1 ");

	return FAULT_CODE_OK;
}

int cpe_get_profile_name(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("m_profile_name", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);

	return	FAULT_CODE_OK;
}


int cpe_get_apn(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("wan_apn", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}

int cpe_get_pdp_type(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("pdp_type", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}

int cpe_get_ppp_auth_type(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("ppp_auth_mode", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);

	return	FAULT_CODE_OK;
}

int cpe_get_ppp_username(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("ppp_username", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}

int cpe_get_ppp_passwd(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("ppp_passwd", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}

int cpe_get_prefer_dns(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("wan1_pridns", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}

int cpe_get_standby_dns(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("wan1_secdns", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}


int cpe_get_mtu(cwmp_t * cwmp, const char * name, char ** value, pool_t * pool)
{
	FUNCTION_TRACE();	
	char tmp[256] = {0};

	cfg_get_item("mtu", tmp, sizeof(tmp)-1);
	*value = pool_pstrdup(pool, tmp);


	return	FAULT_CODE_OK;
}


